<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5 Transitional//EN">
<%@ page pageEncoding="UTF-8" %>
<%@ page import="jp.co.technotree.apl.api.common.Message" %>
<%@page import="jp.co.technotree.apl.api.common.FwCom"%>
<%@page import="jp.co.technotree.apl.cmd.use.Use2000Bean"%>
<jsp:useBean id="formBean" class="jp.co.technotree.apl.cmd.use.Use2000Bean" scope="request" />
<%


%>
<html>
<head>


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes"/>
<link rel='stylesheet' type='text/css' href='../../common/css/use/use2000.css' >
<link rel='stylesheet' type='text/css' href='../../common/css/popUp.css' >

<script type='text/javascript' src='../../common/js/popUp.js'></script>
<script type='text/javascript' src='../../common/js/NumKeyBoard2.js'></script>


<style type="text/css">

	.mainTbl_Left{
		 border: 0px solid #CCCCFF;
		 height:100px;
		 width: 180px;
		 margin-top:-250px;
		 align:center;
	}

	.mainTbl_Right{
		 border: 0px solid #CCCCFF;
		 height:550px;
	}


	.selTitle{
	 font-size:16px;
	 valign:middle;

	}

	.ImageZone{
	 position:absolute;
	 top :115px;
	 right:20px;
	 visibility: visible;

	 width: 200px;
	 height:200px;
	}


	.bottomBtn{
	 position:absolute;
	 bottom :60px;
	 right:10px;
	 visibility: visible;

	 width: 500px;
	 height:50px;
	}


	.OrderReason{
	 position:absolute;
	 top :80px;
	 left:640px;
	 visibility: visible;

	 width: 320px;
	 height:200px;
	}

	.backBtn{
		width: 80px;
		height:50px;
		font-size:18px;
		margin-top:1px;
		background-image: -webkit-gradient(linear, left top, left bottom, from(#6699CC), to(#6699CC),color-stop(0.7,#6688CC));
		color: #fff;
		font-weight:bold;
		text-shadow: -1px 2px rgba(0,0,0,0.2);
		-webkit-border-radius:10px;

		position:relative; z-index:1;
	}

	.confirmBtn2 {
		width: 120px;
		height:40px;
		font-size:18px;
	}

	.confirmBtn3 {
		width: 130px;
		height:50px;
		font-size:18px;
		margin-top:1px;
		background-image: -webkit-gradient(linear, left top, left bottom, from(#6699CC), to(#6699CC),color-stop(0.7,#6688CC));
		color: #fff;
		font-weight:bold;
		text-shadow: -1px 2px rgba(0,0,0,0.2);
		-webkit-border-radius:10px;

		position:relative; z-index:1;
	}
	.orderCompletionBtn {
		width: 120px;
		height:40px;
		font-size:18px;
	}

	.workComplete{
	 position:absolute;
	 bottom :230px;
	 left:640px;
	 visibility: visible;

	 width: 320px;
	 height:200px;
	}

	.orderBtn{
	width: 80px;
	height:50px;
	font-size:18px;
	margin-top:1px;
	background-image: -webkit-gradient(linear, left top, left bottom, from(#6699CC), to(#6699CC),color-stop(0.7,#6688CC));
	color: #fff;
	font-weight:bold;
	text-shadow: -1px 2px rgba(0,0,0,0.2);
	-webkit-border-radius:10px;

	position:relative; z-index:1;
}


</style>



<script language='javascript'>

//画面固定
//document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

var clsNKB = new CNumKeyBoard();

function onInit(){
	//余剰登録完了後、メッセーを出してメイン画面に遷移
	var stateFlg = "<%=formBean.getStateFlg()%>";
	var odrMeth =  "<%=formBean.getOdrMeth()%>";
	
	
	var afterFunc="nextPageJump('use1000');"
	
	if(stateFlg == "back"){
		//発注処理を正常に完了しました
		alert_Info2("<%=Message.getMessage("INF00020").replace("$1", "余剰登録処理")%>",afterFunc);
	}else if(stateFlg == "cancelBack"){
		
		//発注取消・入荷取消の後
		if(odrMeth=="3"){
			//発注取消を正常に完了しました
			alert_Info2("<%=Message.getMessage("INF00020").replace("$1", "発注取消")%>",afterFunc);
			
		}else{
			//入荷取消を正常に完了しました
			alert_Info2("<%=Message.getMessage("INF00020").replace("$1", "入荷取消")%>",afterFunc);
			
		}
	}
	
	//---------------------------------------------
	
	
	
	
	
	
	//-------------------------------------------------------------------------
	//<!-- NumKeyBoard START -->
	ProcStart	= new Date();

	clsNKB.init("NumKeyBoardID");
//	clsNKB.parentElement	= document.getElementById("BodyBlock");

	clsNKB.textFontSize		= 20;
	clsNKB.buttonFontSize	= 30;
	clsNKB.boxX				= 400;
	clsNKB.boxY				= 300;
	clsNKB.boxBalloonOffset	= 210;
	//<!-- NumKeyBoard END -->
	//-------------------------------------------------------------------------

	//確定時にログインユーザコードをデフォルト値せセット
	selectedChange("usrList",<%=formBean.getUsrListKey()%>);
	odrUsrSideDell2(document.getElementById("usrList"));


}


function selectedChange(formSelectId, itemValue){
	var objSelect = document.getElementById(formSelectId);
	var m = objSelect.length;
	var i = 0;

	for(i=0;m>i;i++){
		var arr = objSelect.options[i].value.split("*");
		if(arr[1] == itemValue){
			objSelect.options[i].selected = true;
			break;
		}
	}
}



function nextPageJump(nextPage){
	mainForm = document.getElementById("F1");
	document.getElementById("nextPage").value = nextPage;

	mainForm.submit();
}




//入荷取消の押下
function cancelBtn(){
	//予備品修理貸出出庫Ｔの更新日を比較
	 updateDtCheck("1");

}


//発注取消の押下
function cancelBtn2(){
	//予備品修理貸出出庫Ｔの更新日を比較
	 updateDtCheck("2");

}





//入荷取消の実行
function cancelBtnExe(){
	
	mainForm = document.getElementById("F1");

	var usrListKey = document.getElementById("usrListKey"); 			//完了担当者 キー
	var usrListObj = document.getElementById("usrList");				//完了担当者
	var usrListArr = usrListObj.options[usrListObj.selectedIndex].value.split("*");

	if(usrListArr[1]){
		usrListKey.value = usrListArr[1];
	}

	
	document.getElementById("orderExe").value = "3";
	
	//入荷登録をクリアして発注を未入荷状態にします。よろしいですか？
	if ("undefind"!=confirm_Custom("<%=Message.getMessage("INF01110").replace("$1", "入荷登録").replace("$2", "未入荷")%>")){
		return;
	}
	
	mainForm.submit();
}



//発注取消の押下
function cancelBtnExe2(){
	
	mainForm = document.getElementById("F1");

	var usrListKey = document.getElementById("usrListKey");				//完了担当者 キー
	var usrListObj = document.getElementById("usrList");				//完了担当者
	var usrListArr = usrListObj.options[usrListObj.selectedIndex].value.split("*");

	if(usrListArr[1]){
		usrListKey.value = usrListArr[1];
	}

	
	document.getElementById("orderExe").value = "2";
	
	//発注をキャンセルします。よろしいですか？
	if ("undefind"!=confirm_Custom("<%=Message.getMessage("INF01050").replace("$1", "発注")%>")){
		return;
	}
	mainForm.submit();
	
	
}



//発注方法
function orderPlanChange(){

	var Obj = document.getElementById("OrderPlan");
	var index = Obj.selectedIndex;


	if(index != 0){
		if(index == 1){
			nextPageJump("odr2100");
		}else if(index == 2){
			nextPageJump("odr2200");
		}else if(index == 3){
			nextPageJump("odr2300");
		}

	}
}





//=======================================================select変更連動
//===========================================
//組がが変更された時の処理
//===========================================
//子ノード作成
function selectIn(obj,arrVar,arrTxt){
	var strObject = document.getElementById(obj);
	for(var k=0; k < arrVar.length; k++){
		//optionのvalue属性にセット(key)
		var ele = document.createElement("option");
		ele.value = arrVar[k];
		//optionにセット(value)
		var str = document.createTextNode(arrTxt[k]);
		ele.appendChild(str);

		strObject.appendChild(ele);
	}
}


//子ノード削除
function selectDel(Obj){
	var strObject = document.getElementById(Obj);
	for(var i= strObject.childNodes.length-1; i >= 0;i--) {
		strObject.removeChild(strObject.childNodes[i]);
	}
}


function reformWork(){
	var strWorkCd1Txt= new Array();
	var strWorkNm1Val= new Array();

	var strWorkCd1Txt2= new Array();
	var strWorkNm1Val2= new Array();

	strWorkCd1Txt[0] = "";
	strWorkNm1Val[0] = "";

	strWorkCd1Txt2[0] = "";
	strWorkNm1Val2[0] = "";

	 //=======================================
	 //組リスト取得
	 //=======================================
	 <%
	 Use2000Bean.PullData[] work1NmPullList =formBean.getInputEmpPullList();

	 for (int j=0; j < work1NmPullList.length; j++){
		 Use2000Bean.PullData  data = work1NmPullList[j];
	%>
		strWorkCd1Txt[<%=j+1%>] = "<%=data.value%>"
	 	strWorkNm1Val[<%=j+1%>] = "<%=data.key%>"
	<%}%>
	   //作業内容の子ノードを削除
	   selectDel("odrUsr");
	   //子ノードを作成
	   selectIn("odrUsr",strWorkNm1Val,strWorkCd1Txt);


	 //=======================================
	 //発注担当リスト取得
	 //=======================================
	 <%
	 Use2000Bean.PullData[] work2NmPullList =formBean.getInputEmpPullList2();

	 for (int j=0; j < work2NmPullList.length; j++){
		 Use2000Bean.PullData  data = work2NmPullList[j];
	 %>
		strWorkCd1Txt2[<%=j+1%>] = "<%=data.value%>"
	 	strWorkNm1Val2[<%=j+1%>] = "<%=data.key +"*"+ data.key2%>"
	<%}%>
	   //作業内容の子ノードを削除
	   selectDel("usrList");
	   //子ノードを作成
	   selectIn("usrList",strWorkNm1Val2, strWorkCd1Txt2);


}



//組の区分選択により
function odrUsrSideDell(odrUsr){
	var strWorkCd1Txt= new Array();
	var strWorkNm1Val= new Array();
	var arrCnt=1;
	strWorkCd1Txt[0] = "";
	strWorkNm1Val[0] = "";

	//発注担当者の子ノードを削除
	selectDel("usrList");

	 <%
		 Use2000Bean.PullData[] work1ForWork2List =formBean.getInputEmpPullList2();
		 for (int j=0; j < work1ForWork2List.length; j++){
			 Use2000Bean.PullData  data = work1ForWork2List[j];
	 %>
		 	if(odrUsr.value == "<%=data.key%>"){
		 		strWorkCd1Txt[arrCnt] = "<%=data.value%>"
			 	strWorkNm1Val[arrCnt] = "<%=data.key  +"*"+ data.key2%>"
			 	arrCnt++;
			//組の区分が何も選択ない場合
		 	}else if(odrUsr.value == ""){
		  		reformWork();
		 		return;
		 	}
	 <%}%>


 //子ノードを作成
 selectIn("usrList",strWorkNm1Val,strWorkCd1Txt);



}


//担当者の区分選択により
function odrUsrSideDell2(usrList){
	var strWorkCd1Txt= new Array();
	var strWorkNm1Val= new Array();
	var arrCnt=1;
	strWorkCd1Txt[0] = "";
	strWorkNm1Val[0] = "";

	//key1とkey2を分ける
	var usrListArr = usrList.value.split("*");


	//発注担当者の子ノードを削除
	selectDel("odrUsr");

	 <%
		 Use2000Bean.PullData[] work1ForWorkList =formBean.getInputEmpPullList();
		 for (int j=0; j < work1ForWorkList.length; j++){
			 Use2000Bean.PullData  data = work1ForWorkList[j];
	 %>
		 	if(usrListArr[0] == "<%=data.key%>"){
		 		strWorkCd1Txt[arrCnt] = "<%=data.value%>"
			 	strWorkNm1Val[arrCnt] = "<%=data.key%>"

			 	arrCnt++;
			//組の区分が何も選択ない場合
		 	}else if(usrList.value == ""){
		  		reformWork();
		 		return;
		 	}
	 <%}%>


//子ノードを作成
selectIn("odrUsr",strWorkNm1Val,strWorkCd1Txt);

//発注担当者による組の自動選択
document.getElementById("odrUsr").selectedIndex = 1;

}

//=======================================================select変更連動




//=================================================================
//	データ入力後の処理（使用数量）
//=================================================================
function afterInputData(obj) {

	//obj.value = obj.value.replace(",","");  //コンマを除去
	
	if("useNum" == obj.id){
		//発注数量入力
		document.getElementById("useNum").value = obj.value;

		//０の場合
//		if(obj.value ==0){
//			alert_Custom("<%=Message.getMessage("WRN00060").replace("$1", "発注数量")%>");
//			return ;
//		}
	}

}
//--------------------------------
//カンマ削除関数
//--------------------------------
function delComma(w) {
  var z = w.replace(/,/g,"");
  return (z);
}

//--------------------------------
//	型変換 String→Numeric
//--------------------------------
function convStrToNum(strVal) {
	var cnv = Number(strVal);
	var res = 0;
	if(isNaN(cnv)) {
		// 数値じゃない!
	} else {
		res = cnv;
	}
	return res;
}
//<!-- NumKeyBoard END -->
//----------------------------------------------------------------------



//パップアップ解除
function back(){
	
	//ボタンステータスを戻せる
	document.getElementById("orderExe").value = "";
	
	document.getElementById("opAlertBtn").style.display = "none";
	document.getElementById("opAlert").style.display = "none";
	document.getElementById("opAlertButton").style.display = "none";
	document.getElementById("opAlertTop").style.display = "none";
	document.getElementById("allbackgr").style.display = "none";
}



//「余剰」ボタン押下
function orderBtn(){

	//予備品修理貸出出庫Ｔの更新日を比較
	 updateDtCheck("0");

}




//入力チェックによる背景色を付ける
function validCheck(){
	
	var useNum =document.getElementById("useNum");	   					   //使用数量
	
	var odrUsrObj = document.getElementById("odrUsr");					   //完了担当者(組)
	var usrListObj = document.getElementById("usrList");				   //完了担当者
	var usrList = usrListObj.options[usrListObj.selectedIndex];
	
	
	 //============
	 //背景色付ける
	 //============
	 if(useNum.value==""){
		 useNum.style.backgroundColor = 'pink';
	 }
	 if(compDt.value==""){
		 compDt.style.backgroundColor = 'pink';
     }
	 if(strageArea.value==""){
		 strageArea.style.backgroundColor = 'pink';
     }
	 if(usrList.value==""){
		 usrListObj.style.backgroundColor = 'pink';
		 odrUsrObj.style.backgroundColor = 'pink';
	 }
	 //============
	 //背景色解除
	 //============
	 if(useNum.value!=""){
		 useNum.style.backgroundColor = 'white';
	 }
	 if(compDt.value!=""){
		 compDt.style.backgroundColor = 'white';
	 }
	 if(strageArea.value!=""){
		 strageArea.style.backgroundColor = 'white';
     }
	 if(usrList.value!=""){
		 usrListObj.style.backgroundColor = 'white';
		 odrUsrObj.style.backgroundColor = 'white';
	 }
}


//「余剰登録」実行
function orderBtnExe(){

		mainForm = document.getElementById("F1");

	   //----------------------------------------------

	    var orderNum = document.getElementById("orderNum").value;	           //発注数量
		var useNum =document.getElementById("useNum").value.replace(",","");   //使用数量
		var oldUseNum = "<%=formBean.getUseNum()%>";
		
		
		
		//=============================================================
		//使用数量マイナス値の場合チェック
		var boolMinus= false;
		
		var result =  (Number(oldUseNum) + Number(useNum)).toString();

		if(result.indexOf("-") == 0){
			boolMinus = true;
		}
		//--------------------------------------------------------------
		
		
		
		
		var compDt =document.getElementById("compDt").value;	            //作業完了日
		var odrDt =document.getElementById("odrDt").value;	                //発注日
		
		odrDt = odrDt.replace("/","").replace("/","");
		compDt = compDt.replace("-","").replace("-","");

		var strageAreaObj = document.getElementById("strageArea"); 			//保管場所
		var strageArea = strageAreaObj.options[strageAreaObj.selectedIndex].value;


		var usrListKey = document.getElementById("usrListKey");				//完了担当者 キー
		var usrListObj = document.getElementById("usrList");				//完了担当者
		var usrListArr = usrListObj.options[usrListObj.selectedIndex].value.split("*");

		if(usrListArr[1]){
			usrListKey.value = usrListArr[1];
			
		}else{
			usrListKey.value ="";
		}

		
		validCheck();//入力チェックによる背景色を付ける
		

		//入力チェック
		if(compDt ==""){
			alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "作業完了日")%>");
			return ;
		}else if(useNum ==""){
			alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "使用数量")%>");
			return ;
		}else if(useNum ==""){
			alert_Custom("<%=Message.getMessage("WRN01530").replace("$1", "使用数量")%>");                            //使用数量には０以外の数値を入力して下さい。
			return ;
		}else if(Number(useNum) + Number(oldUseNum) > Number(orderNum)){
			
			document.getElementById("useNum").style.backgroundColor = 'pink'; 										//背景色付ける
			alert_Custom("<%=Message.getMessage("WRN00050").replace("$1", "使用数量").replace("$2", "入荷数量")%>"); 
			 
			return ;
		}else if(strageArea ==""){
			alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "保管場所")%>");
			return ;
		}else if(usrListKey.value ==""){
			alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "完了担当者")%>");
			return ;
		}else if(Number(odrDt) > Number(compDt)){
			alert_Custom("<%=Message.getMessage("WRN00040").replace("$1", "作業完了日").replace("$2", "発注日")%>");
			return ;
		}else if(boolMinus){
			alert_Custom("<%=Message.getMessage("WRN01540").replace("$1", "使用数量").replace("$2", "使用数量")%>");  //「使用数量が入荷数量を超えています。
			return ;
		}else{

			document.getElementById("orderExe").value = "1";

			//予備品の余剰を登録します。よろしいですか？
			if ("undefind"!=confirm_Custom("<%=Message.getMessage("INF01060").replace("$1", "予備品の余剰")%>")){
				return;
			}
			mainForm.submit();

		}

}






//出荷取消ボタン・返却登録のフラグ
var btnFlg="0";

//*************************************************
//AJAX 部分(//予備品修理貸出出庫Ｔの更新日を比較)
//*************************************************
function updateDtCheck(btn){

	if("1"==btn){
		btnFlg = "1";
		
	}else if("0"==btn){
		btnFlg = "0";
		
	}else if("2"==btn){
		btnFlg = "2";
	}
	
	var odrNo = document.getElementById("odrNo").value;

	xmlHttp = new XMLHttpRequest();
	xmlHttp.onreadystatechange = checkStatus2;
	xmlHttp.open("GET","../use2002/use2002?odrNo="+odrNo,true);
	xmlHttp.send(null);

}

function checkStatus2(){
	if (xmlHttp.readyState == 4 && xmlHttp.status == 200){
		var xml = xmlHttp.responseXML;
		var rootNodes = xml.getElementsByTagName("list");
		var rootNode = rootNodes[0];
		var json = JSONConvert(rootNode);
		if (json==null) {
		}else {
			var orderUpdateDt = json.updatedt;
			var confirmUdateDt = document.getElementById("updateDt_hid_odr").value;
			
			//更新日を比較
			if(orderUpdateDt == confirmUdateDt){

				if(btnFlg=="0"){
					orderBtnExe();   //登録実行
				}else if(btnFlg=="1"){
					cancelBtnExe();  //出荷取消実行
				}else if(btnFlg=="2"){
					cancelBtnExe2();  //出荷取消実行
				}

			}else{
				
				//出荷取消ボタン・返却登録のフラグ分岐
				if(btnFlg=="0"){
					//var afterFunc="nextPageJump('ren1000');"
					alert_Custom("<%=Message.getMessage("WRN01105")%>");// →「予備品の発注情報が既に変更されています。余剰登録を再度やり直して下さい。」
					return;
				}else{
					alert_Custom("<%=Message.getMessage("WRN01104")%>");//  →「予備品の発注情報が既に変更されています。入荷取消を再度やり直して下さい。」
					return;
				}

			}

		}
	}
}



function JSONConvert(node){
	var type = node.nodeType;
	if ( isTextNode(node) ){
		var text = getTextValue(node);
		return text;
	}
	if ( type==1 ){
		var json = {};
		var nodeName = node.nodeName;
		var childs = node.childNodes;

		for (var i = 0; i<childs.length; i++){
			var child = childs[i];
			var obj = json[child.nodeName];

			if ( child.nodeType == 1 ){
				if ( obj ){
					var array = null;
					if ( !isArray(obj) ){
						array=[];
						array[array.length]=obj;
					}else{
						array=json[child.nodeName];
					}
					array[array.length]=JSONConvert(child);
					json[child.nodeName]=array;
				}else{
					json[child.nodeName]=JSONConvert(child);
				}
			}
		}
		return json;
	}
}

function isTextNode(node){
	if ( node.hasChildNodes() ){
		var childs = node.childNodes;
		for (var i = 0; i<childs.length; i++){
			var child = childs[i];
			if ( child.nodeType != 3 ) return false;
		}
	}
	return true;
}

function getTextValue(node){
	if ( node.hasChildNodes() ){
		var childs = node.childNodes;
		var child = childs[0];
		if ( child.nodeType == 3 ){
			return child.nodeValue;
		}
	}
	return null;
}

//------------------------------------------------------------------------------




</script>


</head>

<body onLoad="onInit()">
<form name="main" id="F1" action="./use2000" method="post" class="frmMain">

<table style="">
	<!--HEADER TITLE START -->
	<tr style = "background-color:#e1e1e1;  font-weight: bold;  border-bottom:1px solid #e1e1e1; background: -webkit-gradient(linear, left top, left bottom, from(#e1e1e1), to(#ffffff));　 ">
		<td colspan="2" class ="header_tbl" style = "font-size:22px; height:40px;"  align = "left">
			　予備品管理システム (<%=formBean.kojou%>)　　　
			<span style="font-size:30px; text-shadow:2px 2px #666; 	color:#aaa;">直結看板以外余剰登録画面</span>
		</td>
	</tr>
	<!--HEADER TITLE END -->



	<!--メインメニュー画面　START  -->
	<tr style="height:628px; ">

		<td class="right" >
			 <!--<div class="mainLine" id = "mainLine" style="display:inline; " ></div>  -->

			<table width ="100%"  class="mainTbl_Right">
				<!--発注 -->
				<tr>
					<td id="" align = "left"   class="selTitle" colspan="3">　発注方法:<input type="text" name="odrMethNm" id="odrMethNm" class="" style="width:140px; height:25px; font-size:15px; color: black; background-color:#CCC;" value="<%=formBean.getOdrMethNm()%>" readonly>
					</td>
				</tr>

				<tr>
					<td id="" align = "left"   class="selTitle">　Y品番:　
					<input type="text"  class="" name="" id="" style="width: 50px; height:25px; font-size:15px; color:blue;  background-color:#CCC;"  value="<%=formBean.getItemNo1()%>" readonly> -
					<input type="text"  class="" name="" id="" style="width: 50px; height:25px; font-size:15px; color:blue;  background-color:#CCC;" value="<%=formBean.getItemNo2()%>"  readonly>
					</td>

					<td id="" align = "left"   class="selTitle">　発注日:
						<input type="text"  class="" name="odrDt" id="odrDt" style="width: 100px; height:30px; font-size:15px; color:blue;background-color:#CCC;" value="<%=formBean.getOdrDt()%>" readonly>
					</td>

				</tr>
				<tr>
					<td id="" align = "left"  valign="top"  class="selTitle" colspan="3">　品名:　　
						<textarea name="" cols="40" rows="2" style="width:  510px; font-size:15px; color:blue; background-color:#CCC;" readonly  ><%=formBean.getItemNm()%></textarea>
					</td>
				</tr>
                <tr>
					<td id="" align = "left"  valign="top"  class="selTitle" colspan="3">　型式:　　
						<textarea name="" cols="40" rows="2" style="width:  510px; font-size:15px; color:blue; background-color:#CCC;"  readonly ><%=formBean.getModel()%></textarea>
					</td>
				</tr>
				<tr>
					<td id="" align = "left"   class="selTitle" colspan="2">　単価:　　
					<input type="text"  class="" name="" id="" style="width: 100px; height:25px; font-size:15px; color:blue; background-color:#CCC; text-align:right;" readonly  value="<%=formBean.getUnitPrice()%>">
					　L/T:
					<input type="text"  class="" name="" id="" style="width: 100px; height:25px; font-size:15px; color:blue; background-color:#CCC; text-align:right;" readonly  value="<%=formBean.getLeadTm()%>">
					　出庫オーダー:
					<%
					String delvOdr = "";
					Use2000Bean.PullData[] inputDelvOdrList = formBean.getInputDelvOdrList();
					for (int i = 0; inputDelvOdrList != null && i < inputDelvOdrList.length; i++) {
						Use2000Bean.PullData data = inputDelvOdrList[i];
						if(data.key.equals(formBean.getDelvOdr())){
							delvOdr = data.value;
						}
					}
					%>
					<input type="text"  class="" name="" id="" style="width: 100px; height:25px; font-size:15px; color:blue; background-color:#CCC;" readonly  value="<%=delvOdr%>">
					</td>
				</tr>
				<tr>
					<td id="" align = "left"   class="selTitle" colspan="2">　発注数量:
					<input type="text"  class="" name="orderNum" id="orderNum" style="width: 100px; height:25px; font-size:15px; color:blue; background-color:#CCC; text-align:right;" readonly  value="<%=formBean.getOrderNum()%>">
					　手配連番:
					<input type="text"  class="" name="" id="" style="width: 100px; height:25px; font-size:15px; color:blue; background-color:#CCC;" readonly  value="<%=formBean.getOdrSeq()%>"></td>
				</tr>


				<tr>
					<td id="" align = "left"   class="selTitle" colspan="2">　設備機番:
					<%
					String machineNm = "";
					Use2000Bean.PullData[] inputMachineNmList = formBean.getInputMachineNmList();
					for (int i = 0; inputMachineNmList != null && i < inputMachineNmList.length; i++) {
						Use2000Bean.PullData data = inputMachineNmList[i];
						if(data.key.equals(formBean.getMachineNo())){
							machineNm = data.value;
						}
					}
					%>
					<input type="text"  class="ReadStyle" name="machineNo" id="machineNo" style="width: 310px; height:25px; font-size:15px; color:blue; background-color:#CCC;" value="<%=machineNm%>" readonly></td>
				
				</tr>

				<tr>
					<td id="" align = "left"   class="selTitle" colspan="2">　入荷予定年月日:
					<input type="text"  class="" name="" id="" style="width: 100px; height:33px; font-size:15px; color:blue; background-color:#CCC;" readonly   value="<%=formBean.getArrPlanDt()%>" readonly>
					　入荷年月日:
					<input type="text"  class="" name="" id="" style="width: 100px; height:33px; font-size:15px; color:blue; background-color:#CCC;" readonly  value="<%=formBean.getArrDt()%>" readonly></td>
				</tr>

				<!--線を引く -->
				<tr ><td  colspan="4"><hr></td></tr>

				<tr>
					<td id="" align = "left"   class="selTitle" colspan="2">　発注担当者:
						<input type="text"  class="" name="" id="" style="width: 100px; height:25px; font-size:15px; color:blue; background-color:#CCC;" readonly  value="<%=formBean.getOdrUsrKumi()%>">
						<input type="text"  class="" name="" id="" style="width: 100px; height:25px; font-size:15px; color:blue; background-color:#CCC;" readonly  value="<%=formBean.getOdrUsr()%>">
					</td>


					<td id="" align="left"   class="selTitle">使用者:
						<input type="text"  class="" name="useUsrKey" id="useUsrKey" style="width: 100px; height:25px; font-size:15px; color:blue; background-color:#CCC;" readonly  value="<%=formBean.getUseUsr()%>">
					</td>
				</tr>

				<tr>
					<td id="" align = "left"   class="selTitle" colspan="2">　入荷担当者:
						<input type="text"  class="" name="" id="" style="width: 100px; height:25px; font-size:15px; color:blue; background-color:#CCC;" readonly  value="<%=formBean.getArrUsrKumi()%>">
						<input type="text"  class="" name="" id="" style="width: 100px; height:25px; font-size:15px; color:blue; background-color:#CCC;" readonly  value="<%=formBean.getArrUsr()%>">
					</td>
				</tr>

				<tr>
					<td id="" align = "left"   class="selTitle" colspan="2">　完了担当者:
						<select name="odrUsr"  id="odrUsr"  style="width:120px; height:30px; font-size:15px; color:blue;" onChange="odrUsrSideDell(this);">
								<option value=''></option>
								<%
								Use2000Bean.PullData[] inputEmpPullList = formBean.getInputEmpPullList();
								for (int i = 0; inputEmpPullList != null && i < inputEmpPullList.length; i++) {
									Use2000Bean.PullData data = inputEmpPullList[i];
								%>
								<option value='<%=data.key%>' <%=data.selected%> ><%=data.value%></option>
								<%}%>
						</select>
						<select name="usrList"  id="usrList"  style="width:120px; height:30px; font-size:15px; color:blue;" onChange="odrUsrSideDell2(this);">
								<option value=''></option>
								<%
								Use2000Bean.PullData[] inputEmpPullList2 = formBean.getInputEmpPullList2();
								for (int i = 0; inputEmpPullList2 != null && i < inputEmpPullList2.length; i++) {
									Use2000Bean.PullData data = inputEmpPullList2[i];
								%>
								<option value='<%=data.key + "*" + data.key2%>' <%=data.selected%> ><%=data.value%></option>
								<%}%>
						</select>
					</td>
				</tr>
			</table>

			<!-- 発注理由 -->
			<div class="OrderReason">
			<table border="1" style="border-color: #CCCCCF;">
				<tr>
					<td>　【発注理由】</td>
				</tr>
				<tr>
					<td id="" align="left"   class="selTitle">　使用設備:　
						<input type="text"  class="" name="" id="" style="width: 180px; height:25px; font-size:15px; color:blue; background-color:#CCC;" readonly value="<%=formBean.getUseFacil()%>">
					</td>
				</tr>
				<tr>
					<td id="" align="left"   class="selTitle">　使用用途:　
						<input type="text"  class="" name="" id="" style="width: 180px; height:25px; font-size:15px; color:blue; background-color:#CCC;" readonly value="<%=formBean.getUseMeth()%>">
					</td>
				</tr>
				<tr>
					<td id="" align="left"   class="selTitle">　使用予定日:
						<input type="text"  class="" name="" id="" style="width: 100px; height:30px; font-size:15px; color:blue; background-color:#CCC;" readonly value="<%=formBean.getUsePlanDt()%>" readonly>
					</td>
				</tr>
			</table>
			</div>


			<div class="bottomBtn">
				<table>
					<tr>
						<td></td>
						<td align = "right" >
<%if("0".equals(formBean.viewFlg)){%>
							<input type="button"  onclick="cancelBtn();" class="confirmBtn3"  value="入荷取消">
<%}else if("1".equals(formBean.viewFlg)){%>
							<input type="button"  onclick="cancelBtn2();" class="confirmBtn3"  value="発注取消">
<%}else{%>
　　　　　　　　
<%} %>

						</td>
						<td align = "right" >
							<input type="button"  onclick="orderBtn();" class="orderBtn"  value="登録">　　
						</td>
						<td align = "right" >
							<input type="button"  onclick="nextPageJump('use1000');" class="backBtn"  value="戻る">　
						</td>
					</tr>
				</table>
			</div>




			<!-- 作業完了 -->
			<div class="workComplete">
			<table border="1" style="border-color: #CCCCCF;">
				<tr>
					<td>　【作業完了】</td>
				</tr>
				<tr>
					<td id="" align = "left"   class="selTitle" >　作業完了日:
					<input type="date"  class="" name="compDt" id="compDt" style="width: 100px; height:30px; font-size:15px; color:blue;"  value="<%=formBean.getCompDt()%>">
					</td>
				</tr>
				
				<tr>
					<td id="" align="left"   class="selTitle" >　使用数量:　
					<input type="text"  class="useNum" name="useNum" id="useNum"  onclick='clsNKB.setNumKeyBoard(this, 5, 0, true, 200);' onChange='afterInputData(this);' style="width: 100px; height:25px; font-size:15px; color:blue; text-align:right;"  value="" readonly>
					<input type="text"  class="" name="" id="" style="width: 50px; height:25px; font-size:15px; color:blue; background-color:#CCC; text-align:right;" readonly  value="<%=formBean.getUseNum() %>/<%=formBean.getOrderNum()%>">
					</td>
				</tr>

				<tr>
					<td id="" align="left"  class="selTitle">　保管場所:　
						<select name="strageArea"  id="strageArea"  style="width:187px; height:30px; font-size:15px; color:blue;" onChange="">
								<option value=''></option>
								<%
								Use2000Bean.PullData[] inputStrageArea = formBean.getInputStrageArea();
								for (int i = 0; inputStrageArea != null && i < inputStrageArea.length; i++) {
									Use2000Bean.PullData data = inputStrageArea[i];
								%>
								<option value='<%=data.key%>' <%=data.selected%> ><%=data.value%></option>
								<%}%>
						</select>
					</td>
				</tr>
			</table>
			</div>

			<!--ログインMAIN画面　END  -->

		</td>
	</tr>
</table>
	<div class='footer' align='right' style="font-size:35px; background-image: url(../../common/img/toyotaB.png); background-repeat: no-repeat; align:top;" ></div> 
<!-- <div class='ImageZone' align='right' style="font-size:20px; align:top"><img src='../../common/img/XXX.gif' height='180px' width='200px'></div>  -->
	<div id="NumKeyBoardID"></div>


	<!--警告 ポップアップ---------------------------------------------------------------------------- -->
	<div id="allbackgr" class="allbackgr" style="display:none;"></div>
	<div class="opAlertBtn" id = "opAlertBtn" style="display:none;" ></div>
	<div class="opAlertButton" id = "opAlertButton" style="display:none;" ></div>
	<div class="opAlertTop" id = "opAlertTop" style="display:none; font-size:22px;">　予備品管理システム　</div>
	<div class="opAlert" id = "opAlert" style="display:none;"></div>
	<!-- -------------------------------------------------------------------------------------------- -->


	<input type="hidden" id="nextPage" name="nextPage" value="">
	<input type="hidden" id="usrListKey" name="usrListKey" value="">
	<input type="hidden" id="orderExe" name="orderExe" value="">
	<input type="hidden" id="odrNo" name="odrNo" value="<%=formBean.getOdrNo()%>">
	<input type="hidden" id="odrMeth" name="odrMeth" value="<%=formBean.getOdrMeth()%>">
	<input type="hidden" id="updateDt_hid_odr" name="updateDt_hid_odr" value="<%=formBean.getUpdateDt_hid_odr()%>">
	

</form>
</body>
</html>
